package com.ghostbusters.fingertrack.calibration;

import com.ghostbusters.fingertrack.recognition.Recognizer;
import com.ghostbusters.fingertrack.wii.IRPoint;
import com.ghostbusters.fingertracker.util.MapUtil;
import com.ghostbusters.fingertracker.util.Serializer;

public class TestMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Calibration<Character> c = new Calibration<Character>();
		Signature sig = new Signature();
		for (double i = 0; i < 1; i += 0.01) {
			sig.addPoint(new IRPoint(i, i));
		}
		System.out.println(sig);
		// // sig.generateBlurredMatrix(1);
		// // sig.generateRowspace();
		// c.add('a', sig);
		// sig = new Signature();
		// for (int i = 151; i > 50; i--) {
		// sig.addPoint(new IRPoint(i, 150 - i));
		// }
		// sig.normalize(Calibration.CALIBRATION_LENGTH,
		// Calibration.CALIBRATION_SIZE);
		// // sig.generateBlurredMatrix(1);
		// // sig.generateRowspace();
		// // System.out.println(sig);
		// c.add('c', sig);
		// sig = new Signature();
		// for (int i = 0; i < 100; i++) {
		// sig.addPoint(new IRPoint(i, 100));
		// }
		// sig.normalize(Calibration.CALIBRATION_LENGTH,
		// Calibration.CALIBRATION_SIZE);

		// c.add('d', sig);
		Signature signature = Serializer.deserialize(new Signature(),
				"bin/signature.txt");
		Calibration<Character> calibration = Serializer.deserialize(
				new Calibration<Character>(), "bin/calibration.txt");
		signature.normalize();
		System.out.println(calibration);
		System.out.println((new MapUtil<Character>()).findBelowThreshold(
				(new Recognizer<Character>()).match(calibration, sig), 0.1));
	}
}
